package com.rzico.basics.amap.pojo.request;

/**
 * Created by lam on 2018/8/8.
 */
public class ParamsRequest {

    private String key;

    /**
     * 更新/围栏启动&停止 patch
     * 删除 delete
     */
    private String method;

    /**
     * 围栏的全局id
     */
    private String gid;

    /**
     * 围栏名称
     */
    private String name;
    /**
     * 圆形围栏中心点
     */
    private String center;
    /**
     * 圆形围栏半径 单位:米 范围 0～3000
     */
    private String radius;
    /**
     * 多边形围栏坐标点 lon1,lat1;lon2,lat2,lon3,lat3 范围 3<=点个数<=5000
     */
    private String points;
    /**
     * 围栏监控状态
     */
    private Boolean enable;
    /**
     * 过期日期 不能设定创建围栏时间点之前的日期；
     * 格式yyyy-MM-dd； 请设置2055年之前的日期
     */
    private String validTime;
    /**
     * 一周内围栏监控日期的重复模式
     * 样例："Mon,Sat" 表示周一和周六有效。
     * 星期简称如下（首字母大写）：Mon,Tues,Wed,Thur,Fri,Sat,Sun
     */
    private String repeat = "Mon,Tues,Wed,Thur,Fri,Sat,Sun";
    /**
     * 指定日期列表 格式"date1;date2;date3"； date格式"yyyy-MM-dd"； 最大个数180，不能设定过去日期；
     */
    private String fixedDate;
    /**
     * 一天内围栏监控时段
     * 拼接字符串格式如："startTime1,endTime1;startTime2,endTime2"；
     * 最大个数24；
     * 不可为空；
     * 范围00:00-23:59；
     * 时间段不可重叠；
     * 时间段长度>15min
     */
    private String time;
    /**
     * 围栏描述信息
     */
    private String desc;
    /**
     * 配置触发围栏所需动作 enter;leave（进入、离开触发）
     */
    private String alertCondition;

    public String toString() {
        String response = "";

//        if (this.gid != null) {
//            response += ",\"gid\":\"" + this.gid + "\"";
//        }

//        if (this.method != null) {
//            response += ",\"method\":\"" + this.method + "\"";
//        }

//        if (this.name != null) {
//            response += ",\"name\":\"" + this.name + "\"";
//        }

        if (this.name != null) {
            response += ",\"name\":\"" + this.name + "\"";
        }

        if (this.enable != null) {
            response += ",\"enable\":" + this.enable;
        }
        if (this.points != null) {
            response += ",\"points\":\"" + this.points + "\"";
        }

        if (this.repeat != null) {
            response += ",\"repeat\":\"" + this.repeat + "\"";
        }

//         "{\"key\":\"" + this.key + "\"," +
//            "\"name\":\"" + this.name + "\"," +
//            "\"center\":\"" + this.center + "\"," +
//            "\"radius\":\"" + this.radius + "\"," +
//            "\"points\":\"" + this.points + "\"," +
//            "\"enable\":\"" + this.enable + "\"," +
//            "\"valid_time\":\"" + this.validTime + "\"," +
//            "\"repeat\":\"" + this.repeat + "\"," +
//            "\"fixed_date\":\"" + this.fixedDate + "\"," +
//            "\"time\":\"" + this.time + "\"," +
//            "\"desc\":\"" + this.desc + "\"," +
//            "\"alert_condition\":\"" + this.alertCondition + "\"}";

        return "{" + response.replaceFirst(",", "") + "}";

    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCenter() {
        return center;
    }

    public void setCenter(String center) {
        this.center = center;
    }

    public String getRadius() {
        return radius;
    }

    public void setRadius(String radius) {
        this.radius = radius;
    }

    public String getPoints() {
        return points;
    }

    public void setPoints(String points) {
        this.points = points;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getValidTime() {
        return validTime;
    }

    public void setValidTime(String validTime) {
        this.validTime = validTime;
    }

    public String getRepeat() {
        return repeat;
    }

    public void setRepeat(String repeat) {
        this.repeat = repeat;
    }

    public String getFixedDate() {
        return fixedDate;
    }

    public void setFixedDate(String fixedDate) {
        this.fixedDate = fixedDate;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getAlertCondition() {
        return alertCondition;
    }

    public void setAlertCondition(String alertCondition) {
        this.alertCondition = alertCondition;
    }
}
